﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;

using AdventureWorksApp.Web;
using System.ServiceModel.DomainServices.Client;

namespace AdventureWorksApp.Views
{

    public partial class CustomerPage : Page
    {

        private CustomerDomainContext _customerContext = new CustomerDomainContext();

        public CustomerPage()
        {
            InitializeComponent();

            LoadOperation<Customer> loadOp = this._customerContext.Load(this._customerContext.GetCustomerQuery());
            CustomerGrid.ItemsSource = loadOp.Entities;

        }

        // Выполняется, когда пользователь переходит на эту страницу.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

    }
}
